//
//  RecomTableViewCell.m
//  AudioBook_A
//
//  Created by Sansan on 15/4/15.
//  Copyright (c) 2015年 Sansan. All rights reserved.
//

#import "RecomTableViewCell.h"

@implementation RecomTableViewCell

- (void)dealloc
{
    [_myImageView release];
    [_titleLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatView];
    }
    
    return self;
}


- (void)creatView
{
    
    self.myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 0, 44, 44)];
    [self.contentView addSubview:self.myImageView];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(60, 5, 300, 40)];
    [self.contentView addSubview:self.titleLabel];
}

// 加载图片
- (void)setModel:(recommendModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    self.titleLabel.text = model.title;
    
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:_model.albumCoverUrl290] placeholderImage:[UIImage imageNamed:@"bg_albumView_header.png"]];
}


@end
